//
//  PKPlaylistSuroView.m
//  PianKe
//
//  Created by mingtao on 15/10/6.
//  Copyright (c) 2015年 mingtao. All rights reserved.
//

#import "PKPlaylistSuroView.h"
#import <UIImageView+WebCache.h>

@implementation PKPlaylistSuroView



-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        //播放器里面的属性
        _imagecoverimg = [[UIImageView alloc]init];
        _imagecoverimg.frame = CGRectMake(40, 40, WIHES-80, WIHES-80);
        
        [self addSubview:_imagecoverimg];   
        
        _labletitle =[[UILabel alloc]initWithFrame:CGRectMake(80, WIHES-20, WIHES, 30)];
        
        _labletitle.font=[UIFont systemFontOfSize:24];
        [self addSubview:_labletitle];
        
        
        _ButSc = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _ButSc.frame = CGRectMake(50, WIHES+30, 50, 30);
        
        [_ButSc setImage:[UIImage imageNamed:@"iconfont-aixin"] forState:(UIControlStateNormal)];
        
        [self addSubview:_ButSc];
        
        _lableSc=[[UILabel alloc]initWithFrame:CGRectMake(105, WIHES+30, 80, 30)];
        
       // _lableSc.text = @"429";
        
        [self addSubview:_lableSc];
        
        
        _ButReview=[UIButton buttonWithType:(UIButtonTypeCustom)];
        
         _ButReview.frame = CGRectMake(250, WIHES+30, 50, 30);
        
        
        [_ButReview setImage:[UIImage imageNamed:@"iconfont-xiaoxi"] forState:(UIControlStateNormal)];
        
        [self addSubview:_ButReview];
        
        _lablepl=[[UILabel alloc]initWithFrame:CGRectMake(305, WIHES+30, 80, 30)];
        
      //  _lablepl.text = @"82";
        
        [self addSubview:_lablepl];
        
        
        _ButXiaZai = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
        _ButXiaZai.frame = CGRectMake(50, WIHES+80, 20, 20);
        
        [_ButXiaZai setImage:[UIImage imageNamed:@"iconfont-xiazai"] forState:(UIControlStateNormal)];
        
        [self addSubview:_ButXiaZai];
        
                

        _Slider =[[UISlider alloc]initWithFrame:CGRectMake(80, WIHES+80, WIHES-150, 20)];
        
        _Slider.minimumValue=0;
      //  _Slider.maximumValue = 1.0;
        
        //设置滑过去的颜色
        _Slider.minimumTrackTintColor = [UIColor blackColor];
        
        //设置没有滑过去的颜色
        
        _Slider.maximumTrackTintColor = [UIColor grayColor];
        
//        _Slider.maximumValueImage=[UIImage imageNamed:@"iconfont-shu"];
//        _Slider.minimumValueImage = [UIImage imageNamed:@"iconfont-shu"];
        
        [_Slider setThumbImage:[UIImage imageNamed:@"iconfont-shu"] forState:(UIControlStateNormal)];
        
        [self addSubview:_Slider];
        
        //总时间
        _lableTimeZ = [[UILabel alloc]initWithFrame:CGRectMake(WIHES-60, WIHES+75, 50, 30)];
        
       // _lableTimeZ.backgroundColor = [UIColor redColor];
        
        [self addSubview:_lableTimeZ];

    }
    
    return self;

}

//-(void)setConfigureModel:(PKRadioDetail *)configureModel
//{
//    _configureModel = configureModel;
//    
//    [_imagecoverimg sd_setImageWithURL:[NSURL URLWithString:configureModel.coverimg]];
//    
//    _labletitle.text = configureModel.title;
//    //webview_url
//   // NSString *str=configureModel.playInfo.webview_url;
//   // [self loadWebPageWithURLString:str];
//
//}

-(void)setDetaiMode:(PKRadiomDetailModel *)DetaiMode
{
    _DetaiMode = DetaiMode;
    
    NSLog(@"%@",DetaiMode.playInfo.title);
    [_imagecoverimg sd_setImageWithURL:[NSURL URLWithString:DetaiMode.playInfo.imgUrl]];
    
    _labletitle.text = DetaiMode.playInfo.title;
    
    _lablepl.text =[NSString stringWithFormat:@"%ld",DetaiMode.comment];
    _lableSc.text = [NSString stringWithFormat:@"%ld",DetaiMode.like];
    
    
    
    
    
    

}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
